feat: 分享文件二级页统一 + 冷启动不自动重播#27
Merged
Merged
Conversation
- 文件票据降为带返回的二级页(Screen.file),头部换成 ← + 「分享文件」+ ⚙,与传递文本同款;品牌名只留主页 - 主页新增「正在分享」横幅:文件后台续跑时一键回二维码(运行缀呼吸点、停止显静默) - 冷启动不再自动重播上次分享,开 app 落主页;上次分享留「最近分享」一键重发(对齐文本「重启不自动重播」的安全姿态) - 只关窗不退出仍服务续播、唤回即回原状——界面如实反映「服务是否还活着」 - 无网络页补返回按钮;传递文本入口呼吸点判据收紧,免得跑文件时误亮 - 退役仅供冷启动恢复的 lastSharedPaths / lastFolderPath 键 - PLAN.md 记入新路由模型与冷启动安全姿态
- init 落地屏判据去掉恒为真的 sharedItems.isEmpty 子条件(冷启动不恢复分享,此处必空) - 修正 pendingOpenURLs 注释:不再「覆盖恢复的旧分享」(恢复块已删),改为据 open 事件落文件票据
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
#25 / #26 给 app 引入了功能主页(拖拽分享 + 传递文本入口)和二级页(传递文本、设置、历史,都有
←返回、退回后功能后台续跑)。但最早的「分享文件」没补上这套二级设计:.share一个路由被主页和文件票据共用、靠数据切换,票据页天然没返回按钮——更要紧的是一旦分享文件就被锁在票据页,够不到「传递文本」(服务端明明支持文件+文本并存)。本 PR 把文件分享对齐到传递文本:一个带返回按钮的二级页。
改了什么
Screen.file:头部换成← + 「分享文件」+ ⚙,与TextScreen同款;品牌名「LocalShare」只留主页。setShared落.file、goShare()回主页、新增enterFile()。ActiveShareBanner:文件后台续跑、退回主页时,顶部出紧凑可点行一键回二维码(运行缀呼吸点、停止显静默)。前导 qrcode 图标 + 尾部 chevron 暗示「点这回到码」,不堆文案。lastSharedPaths/lastFolderPath),开 app 落主页、上次分享留「最近分享」一键重发——对齐文本「重启不自动重播」的安全姿态,开 app 不再把某文件夹悄悄端上 LAN。applicationShouldTerminateAfterLastWindowClosed=false+@StateObject整进程只建一次,唤回窗口即回离开时那一屏。原则落进注释:界面如实反映「服务是否还活着」。传递文本入口呼吸点判据收紧为isRunning && (hasText || textInboxEnabled),免得跑文件时误亮。PLAN.md记入新路由模型与冷启动安全姿态。**移除了「开 app 即见码」**这条既有便利(CLAUDE.md 曾列为核心承诺),换成开 app 落主页 + 「最近分享」一键重发。这是有意的产品取舍——以「不在新网络环境悄悄重新暴露上次分享」为先。
验证
swift build✅ /swift test45/45 ✅